//
//  FaBuPeiHu1ViewController.m
//  XiangMu
//
//  Created by 康世标 on 15/7/15.
//  Copyright (c) 2015年  codss. All rights reserved.
//
#define IS_IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8)

#import "FaBuPeiHu1ViewController.h"


@implementation ZYButton

@synthesize isID;

@end
@interface FaBuPeiHu1ViewController ()

@end

@implementation FaBuPeiHu1ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    // 返回
    self.title=@"发布陪护";
    self.tabBarController.tabBar.hidden=YES;
    
    UIButton*fanHuiBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    fanHuiBtn.frame=CGRectMake(20, 20, 10, 20);

    [fanHuiBtn addTarget:self action:@selector(FanHui) forControlEvents:UIControlEventTouchUpInside];
    [fanHuiBtn setBackgroundImage:[UIImage imageNamed:@"fanhui"] forState:UIControlStateNormal];
    UIBarButtonItem*barFanHui=[[UIBarButtonItem alloc]initWithCustomView:fanHuiBtn];
    self.navigationItem.leftBarButtonItem=barFanHui;
    
    tableview = [[UITableView alloc]initWithFrame:CGRectMake(10,10,10,10) style:UITableViewStylePlain];
    
    tableview.backgroundColor = CL_00cc85;

    tableview.delegate = self;
    
    tableview.dataSource = self;
    
    tableview.hidden = YES;
    
   
    
    [self.textView.layer setBorderWidth:.5];
    [self.fabuBtn setBackgroundColor:CL_00cc85];
    [self.fangShiBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.fangShiBtn.layer setBorderWidth:1];
    [self.shiChangBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.shiChangBtn.layer setBorderWidth:1];
    [self.shiJianBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.shiJianBtn.layer setBorderWidth:1];
    [self.tiZhongBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.tiZhongBtn.layer setBorderWidth:1];
    [self.leiXingBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.leiXingBtn.layer setBorderWidth:1];
    [self.chengDuBtn.layer setBorderColor:CL_00cc85.CGColor];
    [self.chengDuBtn.layer setBorderWidth:1];
    [self QingQiu];
    
    self.indexRow = 0;
    
     hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    hud.labelText = @"数据加载中...";
     [self.scrollView addSubview:tableview];
}
- (void)QingQiu{
    
    [QingQiuShuJu HuoQuFaBuShiDeShuJu:^(NSMutableArray *arr, BOOL isOK) {
        
        if (isOK)
        {
            if (arr.count ==0) {
                
                hud.removeFromSuperViewOnHide = YES;
                hud.mode = MBProgressHUDModeText;
                hud.labelText = @"服务器异常";
                [hud hide:YES afterDelay:2];
                
                return ;
            }
            
            self.datasArr =arr;
//            [tableview reloadData ];
            [self.fangShiBtn setTitle:[[[self.datasArr valueForKey:@"carerWays" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            
            self.fangShiBtn.isID = [[[[self.datasArr valueForKey:@"carerWays"]objectAtIndex:0] valueForKey:@"id"] longValue];
            
            [self.leiXingBtn setTitle:[[[self.datasArr valueForKey:@"carerTypes" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            
            self.leiXingBtn.isID = [[[[self.datasArr valueForKey:@"carerTypes"]objectAtIndex:0] valueForKey:@"id"] longValue];
            
            
            [self.tiZhongBtn setTitle:[[[self.datasArr valueForKey:@"weightTypes" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            self.tiZhongBtn.isID = [[[[self.datasArr valueForKey:@"weightTypes"]objectAtIndex:0] valueForKey:@"id"] longValue];
            
            
            [self.shiJianBtn setTitle:[[[self.datasArr valueForKey:@"decadeTypes" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            self.shiJianBtn.isID = [[[[self.datasArr valueForKey:@"decadeTypes"]objectAtIndex:0] valueForKey:@"id"] longValue];
            
            
            [self.chengDuBtn setTitle:[[[self.datasArr valueForKey:@"selfCareAbilitys" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            self.chengDuBtn.isID = [[[[self.datasArr valueForKey:@"selfCareAbilitys"]objectAtIndex:0] valueForKey:@"id"] longValue];
            
            
            [self.shiChangBtn setTitle:[[[self.datasArr valueForKey:@"timeTypes" ] objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            
             self.shiChangBtn.isID = [[[[self.datasArr valueForKey:@"timeTypes"]objectAtIndex:0] valueForKey:@"id"] longValue];
             [hud setHidden:YES];
            
            hud.removeFromSuperViewOnHide = YES;
            
            
        }
        else{
            hud.removeFromSuperViewOnHide = YES;
            hud.mode = MBProgressHUDModeText;
            hud.labelText = @"网络连接失败";
            [hud hide:YES afterDelay:2];
        }
    }];
}
- (void)DingWei{
 
    __weak FaBuPeiHu1ViewController * wself =self ;
    
    
    TheMap * the = [[TheMap alloc]init];
    the.block = ^void(NSString * addr){
        wself.weiZhi.text = addr;

    };
    
    [self.navigationController pushViewController:the animated:YES];
    
    
}
//    if (IS_IOS8) {
//        [UIApplication sharedApplication].idleTimerDisabled = TRUE;
//        locationmanager = [[CLLocationManager alloc] init];
//        [locationmanager requestAlwaysAuthorization];        //NSLocationAlwaysUsageDescription
//        [locationmanager requestWhenInUseAuthorization];     //NSLocationWhenInUseDescription
//        locationmanager.delegate = self;
//    }
//    
//    
//    [self getAllInfo];
//    
//}
//
//-(void)getAllInfo
//{
////    __block NSString *string;
//    __weak FaBuPeiHu1ViewController *wself = self;
//    
//            [[CCLocationManager shareLocation]getLocationCoordinate:^(CLLocationCoordinate2D locationCorrrdinate)
//         {
////             string = [NSString stringWithFormat:@"-w-w---%f %f",locationCorrrdinate.latitude,locationCorrrdinate.longitude];
//         } withAddress:^(NSString *addressString)
//         {
//             //            NSLog(@"1--------%@",addressString);
////           string = [NSString stringWithFormat:@"2----%@\n%@",string,addressString];
//             
//          
//             wself.weiZhi.text = addressString;
//             
//         }];
//    
//    
//}
//返回
- (void)FanHui{
    self.tabBarController.tabBar.hidden=NO;
    [self.navigationController popViewControllerAnimated:YES];
    
    
}

- (IBAction)CanDan:(UIButton*)button{
    CGRect rect;
    rect.origin.x=button.frame.origin.x;
    rect.origin.y=button.frame.origin.y+button.frame.size.height;
    rect.size.width=button.frame.size.width;
      tableview.hidden=NO;
    

    if (!isTableView) {
          tableview.hidden=NO;
    }
    else{
        tableview.hidden=YES;
    }
    isTableView=!isTableView;
    
    self.indexBtn = button.tag;
    switch (button.tag) {
        case 1:
        {
            NSLog(@"陪护方式");
            
            self.datouArr = [self.datasArr valueForKey:@"carerWays"];
        
            
        }
            break;
        case 2:
        {
             NSLog(@"陪护类型");
            self.datouArr = [self.datasArr valueForKey:@"carerTypes"];

        }
            break;
        case 3:
        {
            self.datouArr = [self.datasArr valueForKey:@"weightTypes"];

             NSLog(@"个人体重");
        }
            break;
        case 4:
        {
            self.datouArr = [self.datasArr valueForKey:@"decadeTypes"];

             NSLog(@"陪护时间");
        }
            break;
        case 5:
        {
            self.datouArr = [self.datasArr valueForKey:@"selfCareAbilitys"];

             NSLog(@"自理程度");
        }
            break;
        case 6:
        {
            self.datouArr = [self.datasArr valueForKey:@"timeTypes"];
            
           
             NSLog(@"陪护时长");
        }
            break;

        default:
            break;
    }
//    rect.size.height=100;
    if (button.tag ==2) {
        NSMutableArray * arr = [[NSMutableArray alloc]initWithCapacity:0];
        
        
        for (NSDictionary * dic in [self.datasArr valueForKey:@"carerTypes"])
        {
            
            
            
            if ([[[[self.datasArr valueForKey:@"carerWays"] objectAtIndex:self.indexRow] valueForKey:@"id"] intValue] ==[[dic valueForKey:@"hcType"] intValue])
            {
               
                [arr addObject:dic];
                
            }
            
            
        }
         rect.size.height = arr.count*30;

    }
    else{
          rect.size.height = self.datouArr.count*30;
    }
  
    tableview.frame=rect;
  
    [tableview reloadData];
}
#pragma mark---UITableViewDataSource,UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ NSLog(@"---s-这个代理执行了几次");
    if (self.indexBtn == 2)
    {
        NSLog(@"----这个代理执行了几次");
 
        NSMutableArray * arr = [[NSMutableArray alloc]initWithCapacity:0];
        
      
        for (NSDictionary * dic in [self.datasArr valueForKey:@"carerTypes"])
        {
            
            NSLog(@"-----%d",[[self.datasArr valueForKey:@"carerTypes"] count]);
         
            
            if ([[[[self.datasArr valueForKey:@"carerWays"] objectAtIndex:self.indexRow] valueForKey:@"id"] intValue] ==[[dic valueForKey:@"hcType"] intValue])
            {
                   NSLog(@"--dic---%d",arr.count);
                [arr addObject:dic];
                
            }
            
            
        }

        NSLog(@"----fanhui ----%d",arr.count);
        return arr.count;
        
        
    }
    else{
         return [self.datouArr count];
    }

   
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString*str=@"";
    UITableViewCell*cell=[tableview dequeueReusableCellWithIdentifier:str];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];
    
        UILabel * lable = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 80, 29)];
        lable.tag = 100;
        lable.textColor = [UIColor blackColor];
        
        lable.font = [UIFont systemFontOfSize:13];
        lable.textAlignment = NSTextAlignmentCenter;
        
        [cell.contentView addSubview:lable];
        
    }

    
    UILabel * lable= (UILabel *)[cell.contentView viewWithTag:100];
    
//    lable.text = [[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"];
    
    if (self.indexBtn == 2)
    {
        
//        NSLog(@"----%@",self.datouArr);
        NSMutableArray * arr = [[NSMutableArray alloc]initWithCapacity:0];
        
        for (NSDictionary * dic in [self.datasArr valueForKey:@"carerTypes"])
        {
            if ([[[[self.datasArr valueForKey:@"carerWays"] objectAtIndex:self.indexRow] valueForKey:@"id"] intValue] ==[[dic valueForKey:@"hcType"] intValue])
            {
                
                [arr addObject:dic];
                
            }
            
            
        }
        
        lable.text = [[arr objectAtIndex:indexPath.row] valueForKey:@"type"];

        
    }
    else{
        lable.text = [[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"type"];
    }
//     lable.text = [[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"type"];
   
    if (indexPath.row == 0) {
        lable.textColor = [UIColor whiteColor];
        cell.backgroundColor =CL_00cc85;
    }
    else{
        
        cell.backgroundColor = CL_efeff4;
        lable.textColor = [UIColor blackColor];
    }
   
    return cell;
    
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 30;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    tableview.hidden=YES;
    isTableView=NO;
    
    switch (self.indexBtn) {
        case 1:
        {
            NSLog(@"陪护方式");
            
            self.datouArr = [self.datasArr valueForKey:@"carerWays"];
            
            
            [self.fangShiBtn setTitle:[[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"]forState:UIControlStateNormal];
            self.fangShiBtn.isID = [[[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];
            
            if (self.indexBtn==1) {
                 self.indexRow = indexPath.row;
            }
            
           
            
            
            NSMutableArray * arr = [[NSMutableArray alloc]initWithCapacity:0];
            
            for (NSDictionary * dic in [self.datasArr valueForKey:@"carerTypes"])
            {
                if ([[[[self.datasArr valueForKey:@"carerWays"] objectAtIndex:self.indexRow] valueForKey:@"id"] intValue] ==[[dic valueForKey:@"hcType"] intValue])
                {
                    
                    [arr addObject:dic];
                    
                }
                
                
            }
            
            [self.leiXingBtn setTitle:[[arr objectAtIndex:0] valueForKey:@"type"] forState:UIControlStateNormal];
            
            self.leiXingBtn.isID = [[[arr objectAtIndex:0] valueForKey:@"id"] longValue];
            
        
        }
            break;
        case 2:
        {
            NSLog(@"陪护类型");
            self.datouArr = [self.datasArr valueForKey:@"carerTypes"];
            
            
            NSMutableArray * arr = [[NSMutableArray alloc]initWithCapacity:0];
            
            for (NSDictionary * dic in [self.datasArr valueForKey:@"carerTypes"])
            {
                if ([[[[self.datasArr valueForKey:@"carerWays"] objectAtIndex:self.indexRow] valueForKey:@"id"] intValue] ==[[dic valueForKey:@"hcType"] intValue])
                {
                    
                    [arr addObject:dic];
                    
                }
                
                
            }
            
            [self.leiXingBtn setTitle:[[arr objectAtIndex:indexPath.row] valueForKey:@"type"] forState:UIControlStateNormal];
            
            self.leiXingBtn.isID = [[[arr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];
            
            if (self.indexBtn == 1) {
                  self.indexRow = indexPath.row;
            }
          


        }
            break;
        case 3:
        {
            self.datouArr = [self.datasArr valueForKey:@"weightTypes"];
            [self.tiZhongBtn setTitle:[[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"] forState:UIControlStateNormal];
            self.tiZhongBtn.isID = [[[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];

            NSLog(@"个人体重");
        }
            break;
        case 4:
        {
            self.datouArr = [self.datasArr valueForKey:@"decadeTypes"];
            [self.shiJianBtn setTitle:[[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"] forState:UIControlStateNormal];
            self.shiJianBtn.isID = [[[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];

            NSLog(@"陪护时间");
        }
            break;
        case 5:
        {
            self.datouArr = [self.datasArr valueForKey:@"selfCareAbilitys"];
            [self.chengDuBtn setTitle:[[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"] forState:UIControlStateNormal];
            self.chengDuBtn.isID = [[[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];

            NSLog(@"自理程度");
        }
            break;
        case 6:
        {
            self.datouArr = [self.datasArr valueForKey:@"timeTypes"];
            [self.shiChangBtn setTitle:[[self.datouArr objectAtIndex:indexPath.row]valueForKey:@"type"] forState:UIControlStateNormal];
            self.shiChangBtn.isID = [[[self.datouArr objectAtIndex:indexPath.row] valueForKey:@"id"] longValue];

            NSLog(@"陪护时长");
        }
            break;
            
        default:
            break;
    }
}
- (IBAction)FaBu:(id)sender
{
    NSLog(@"----%@",self.fabuBtn.titleLabel.text);
    
    
    if ([UserManager login]) {
        
        [[[UIAlertView alloc]initWithTitle:@"请登录" message:nil delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil]show];
        
        return;
    }

    
   hud =[MBProgressHUD showHUDAddedTo:self.view animated:YES];
 
    if ([self.xingMing.text isEqualToString:@""]||self.xingMing==nil)
    {
        hud.mode = MBProgressHUDModeText;
        hud.labelText = @"请输入姓名";
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
            return;
    }
    if ([self.xingBie.titleLabel.text isEqualToString:@""]||self.xingBie==nil) {
        hud.mode = MBProgressHUDModeText;
        hud.labelText = @"请输入性别";
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
        return;
    }
    
    if ([self.shouJi.text isEqualToString:@""]||self.shouJi == nil) {
        hud.mode = MBProgressHUDModeText;
        hud.labelText = @"请输入手机号码";
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
        return;
    }
    
    if ([self.nianLing.text isEqualToString:@""]||self.nianLing == nil) {
        hud.mode = MBProgressHUDModeText;
        hud.labelText = @"请输入年龄";
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
        return;
    }
    
    if ([self.weiZhi.text isEqualToString:@""]||self.weiZhi == nil)
    {
        hud.mode = MBProgressHUDModeText;
        hud.labelText = @"请输入您的地址";
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
        return;
    }
    [self FaBuPeiHu];
}
- (void)FaBuPeiHu{
    
    NSMutableDictionary * dic =[[NSMutableDictionary alloc]initWithCapacity:0];
    
  
    
    long x= [[[NSUserDefaults standardUserDefaults] objectForKey:@"ID"] longValue];
    
    
//    NSLog(@"---%d",x);
    [dic setObject:@(x) forKey:@"userId"];
    [dic setObject:@"杭州" forKey:@"city"];
    
    [dic setObject:@(self.leiXingBtn.isID) forKey:@"carerTypeId"];
    [dic setObject:self.leiXingBtn.titleLabel.text forKey:@"carerType"];
    
    [dic setObject:@(self.tiZhongBtn.isID) forKey:@"weightTypeId"];
    [dic setObject:self.tiZhongBtn.titleLabel.text forKey:@"weightType"];
    
    [dic setObject:@(self.shiJianBtn.isID) forKey:@"decadeTypeId"];
    [dic setObject:self.shiJianBtn.titleLabel.text forKey:@"decadeType"];
    
    [dic setObject:@(self.chengDuBtn.isID) forKey:@"selfCareAbilityId"];
    [dic setObject:self.chengDuBtn.titleLabel.text forKey:@"selfCareAbility"];
    
    [dic setObject:@(self.fangShiBtn.isID) forKey:@"hcType"];
    
    [dic setObject:@(self.shiChangBtn.isID) forKey:@"timeTypeId"];
    [dic setObject:self.shiChangBtn.titleLabel.text forKey:@"timeType"];
    
    [dic setObject:self.xingMing.text forKey:@"cname"];
    
    [dic setObject:@([self.nianLing.text integerValue]) forKey:@"cage"];
    
    //     1 nan 2nv
    
    
    [dic setObject:@([self.shouJi.text integerValue])forKey:@"ctel"];
    
    [dic setObject:self.weiZhi.text forKey:@"address"];
    
    [dic setObject:self.textView.text forKey:@"remark"];
    
    if ([self.xingBie.titleLabel.text isEqualToString:@"男"])
    {
        [dic setObject:@(1)forKey:@"csex"];
    }
    
    if ([self.xingBie.titleLabel.text isEqualToString:@"女"])
    {
        [dic setObject:@(2)forKey:@"csex"];
    }
    
    [QingQiuShuJu FaBuPeiHu:dic HuiChuan:^(NSMutableArray *arr, BOOL isOK) {
//        hud = [[MBProgressHUD alloc] initWithView:self.view];
        if (isOK) {
            
            if ([[arr valueForKey:@"status"] intValue]==200)
            {
             hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]];
                

                hud.mode = MBProgressHUDModeCustomView;
                
                hud.labelText = @"发布成功";

                [hud hide:YES afterDelay:1];
                
                [self performSelector:@selector(goFaBu) withObject:self afterDelay:1];
                
            }
            else{
                hud.mode = MBProgressHUDModeText;
                
                hud.labelText = @"发布失败";
                [hud show:YES];
                [hud hide:YES afterDelay:2];
            }
            
        }
        else{
            hud.mode = MBProgressHUDModeText;
            
            hud.labelText = @"网络连接错误";
            [hud show:YES];
            [hud hide:YES afterDelay:2];
        }
    }];

}
- (IBAction)DingWei:(id)sender
{
    
    [self DingWei];
}
#pragma mark---UITextViewDelegate

-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    if ([text isEqualToString:@"\n"])
    {
        [UIView animateWithDuration:1 animations:^{
//            self.topLayout.constant=0;
        }];

        [textView resignFirstResponder];
        return NO;
    }
    
    return YES;
}
- (void)textViewDidBeginEditing:(UITextView *)textView{
    
    [UIView animateWithDuration:1 animations:^{
//           self.topLayout.constant=-240;
    }];
 
    
    
    
 
}
-(void)textViewDidChange:(UITextView *)textView  {
    if (textView.text.length==0)
    {
        self.lable.text = @" 请填写详细信息";
    }
    else{
        self.lable.text=@"";
    }
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    
    [textField resignFirstResponder];
    
    return YES;
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.scrollView endEditing:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)XuanZeXingBie:(id)sender {
    
    UIActionSheet * actionSheet = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"男",@"女", nil];
    
    [actionSheet showInView: self.view ];
}

#pragma mark ---UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSLog(@"---%@",[actionSheet buttonTitleAtIndex:buttonIndex]);
    
    if (buttonIndex ==2)
    {
        
        return;
    }
    
    [self.xingBie setTitle:[actionSheet buttonTitleAtIndex:buttonIndex] forState:UIControlStateNormal];
    
    
}
#pragma makr --- AlertViewdelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    
    if (buttonIndex==0) {
        
        DengLuViewController * de = [[DengLuViewController alloc]init];
        
        UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:de];
        
        [self presentViewController:nav animated:YES completion:nil];
    }
    
}
-(void)goFaBu{
    
    HasBeenEeleased * has = [[HasBeenEeleased alloc]init];
    
    [self.navigationController pushViewController:has animated:YES];
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
